			
		var modalWindow = null;
		
		function showModalWindow(url, dialogArguments, features, callback){
			if (window.showModalDialog) {
				// 有原生功能
				var result = window.showModalDialog(url, dialogArguments, features);
				if (callback) {
					callback(result);
				}
			} else {
				if (modalWindow!=null&&!modalWindow.closed){
					if (confirm("前一个窗口的操作还未完成，要强制关闭它吗？")){
						modalWindow.close();
					}else{
						modalWindow.focus();
					}
				}
				if (modalWindow==null||modalWindow.closed){
					// 模拟
					features = replaceFeatures(features);
					
					modalWindow = window.open(
							url,
							"",
							features
					);
					
					modalWindow.onbeforeunload = function(event){
						result = event.target.returnValue;
						if (callback) {
							callback(result);
						}
					};
				}
			}
		}
		
		function replaceFeatures(features){
			if (features)var features = features.replace(/(dialog)|(px)/ig, "").replace(/;/g, ',').replace(/\:/g, "=");
			var width = parseInt(features.match(/width[\s]*=[\s]*([\d]+)/i)[1]);
			var height = parseInt(features.match(/height[\s]*=[\s]*([\d]+)/i)[1]);
			var left = (window.screen.width - width) / 2;
			var top = (window.screen.height - height) / 2;
			features = "left="+left+","+"top="+top+","+features;
			
			return features;
		}
		
		function allPrpos ( obj ) { 
			  // 用来保存所有的属性名称和值 
			  var props = "" ; 
			  // 开始遍历 
			  var funcCount = 0;
			  for ( var p in obj ){
				  // 方法 
				  if ( typeof ( obj [ p ]) == "function" ){
					  props += p + " = function()... \n " ;
					  funcCount++;
					  // obj [ p ]() ; 
				  } else { 
					  // p 为属性名称，obj[p]为对应属性的值 
					  props += "["+typeof ( obj [ p ])+"]" + p + " = " + obj [ p ] + " \n " ; 
				  }
			  }
			  props += "funcCount = " + funcCount; 

			  // 最后显示所有的属性 
			  alert ( props ) ;
		}
